<script type="text/javascript">
$(function(){
	 $.get("applicationSingle/getCardInfo",function(item){
		var contentb="<option value=''>请选择</option>";
		var contenta="<option value=''>请选择</option>";
		if(item.cdPhysicsTypes!=null&&item.cdProDefinitions!=null){
			for(i=0;i<item.cdPhysicsTypes.length;i++){
				if(item.cdPhysicsTypes[i].cardTypeCode=="0"){
					contenta+="<option value="+item.cdPhysicsTypes[i].cardTypeCode+">"
					+item.cdPhysicsTypes[i].cardTypeName+"</option>"
				}	
			}
			 for(i=0;i<item.cdProDefinitions.length;i++){
				 if(item.cdProDefinitions[i].cardpCode=="15"||item.cdProDefinitions[i].cardpCode=="16"){
					 contentb+="<option value="+item.cdProDefinitions[i].cardpCode+">"
					 +item.cdProDefinitions[i].cardpName+"</option>"	
				 }
						
			} 
		}
		$("#cardPCodeByCenerateNo").html(contentb);
		$("#cardPhysicalTypeByCenerateNo").html(contenta);
	},"json"); 
});
 function generateCardNumber(){
	var cardPCode=$("#cardPCodeByCenerateNo").val();
	var cardPhysicalType=$("#cardPhysicalTypeByCenerateNo").val();
	var cardNoNUm=$("input[name='cardNoNUm']").val();
	if(cardPCode!=""&&cardPhysicalType!=""){
		$.post("fileEntering/generateCardNumber",{cardPCode:cardPCode,cardPhysicalType:cardPhysicalType,cardNoNUm:cardNoNUm},function(json){
			if(json.statusCode==DWZ.statusCode.error){
				navTabAjaxDone(json);
			}else if(json.statusCode==DWZ.statusCode.ok){
				alertMsg.correct("卡号生成成功,路径\n"+json.message)
			}
		},"json");
	}else{
		alertMsg.info('卡产品，卡物理类型不能为空');
	}
	return false; 
}
</script>
<div class="pageContent">
	<form method="post" action="" class="pageForm required-validate" onsubmit="return formSubmit(this);">
		<div class="pageFormContent" layoutH="56">
			
			<p>
				<label>卡产品：</label>
				<select id="cardPCodeByCenerateNo" name="cardPCode" class="required">
				
				</select>
			</P>
			<p>
				<label>卡物理类型：</label>
				<select id="cardPhysicalTypeByCenerateNo" name="cardPhysicalType" class="required">
				
				</select>
			</P>
			<p>
				<label>生成数量：</label>
				<input name="cardNoNUm" class="required">
			</P>
			 <a class="button"  href="#" onclick="return generateCardNumber();" ><span>生成卡号</span></a><br /><br />
			 </div>
	</form>
</div>